#!/usr/bin/env python
# coding=utf-8
from flask import Blueprint

from plant.base.beanret import BeanRet
from plant.service.highaccuracytemperature import HighTemp

pitop = Blueprint('temp', __name__)


@pitop.route('/temp/read')
def read():
    '''
    read tem and humi
    :return:
    '''
    sensor = HighTemp()
    temp = sensor.read()
    return BeanRet(success=True, data={'temp': temp}).toJson()
